package com.xdf.whiteaccount.enums;

/**
 * @author chanchaw
 * @create 2023-05-17 07:46
 */
public enum MoveBillFlag {
    NEXT(0,"next","下一单"),PREVIOUS(1,"prev","上一单"),
    FIRST(2,"first","首单"),LAST(3,"last","末单"),
    ;
    private int index;
    private String flag;
    private String desc;

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    MoveBillFlag(int index,String flag, String desc) {
        this.index = index;
        this.flag = flag;
        this.desc = desc;
    }

    // 根据索引返回枚举值
    static MoveBillFlag of(int index){
        for(MoveBillFlag item:MoveBillFlag.values()){
            if(item.getIndex() == index) return item;
        }
        return null;
    }
}
